package com.example.rabbitmqdemo.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-04-06
 * Time: 14:53
 */
@Component
public class ClusterConsumer {
    //推消息
    @RabbitListener(queues = "cluster.queue")
    public void handleMessage(Message message) {
        System.out.println("cluster.queue收到消息: " + message);
    }
}
